//
//  BAXSubTableView.m
//  bianxiong
//
//  Created by lukyshine on 16/8/4.
//  Copyright © 2016年 CJ. All rights reserved.
//

#import "BAXSubTableView.h"
#import "PoolOrderCell.h"
#import "Poolinfo_ViewController.h"
#import "PayOrderVC.h"

@interface BAXSubTableView ()
@property(nonatomic,strong) NSArray *data;
@end

@implementation BAXSubTableView

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.backgroundColor = LXHexColor(0xF5F6F7);
    [self.tableView registerNib:[UINib nibWithNibName:@"PoolOrderCell" bundle:nil]forCellReuseIdentifier:@"orderCell"];
    self.tableView.tableFooterView = [[UIView alloc]init];
}


//去付款
- (void)toPay:(UIButton *)sender
{
    PayOrderVC * pay = [[PayOrderVC alloc]init];
    [self.navigationController pushViewController:pay animated:YES];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 5;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    PoolOrderCell *cell = [tableView dequeueReusableCellWithIdentifier:@"orderCell"];
    [cell.payBtn addTarget:self action:@selector(toPay:) forControlEvents:UIControlEventTouchUpInside];
    cell.cancelBtn.layer.cornerRadius= 4;
    cell.cancelBtn.layer.masksToBounds = YES;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // 取消选中状态
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    Poolinfo_ViewController * vc = [[Poolinfo_ViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 290;
}


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}

@end
